package com.jinyi.wwdeng.ui.main.contract

import com.jinyi.base.mvp.IBasePresenter
import com.jinyi.base.mvp.IBaseView
import org.json.JSONObject

/**
 * JinYiTest
 * @Author wwdeng
 * @CreateTime: 2024/4/28 16:16
 * @Annotation：贷款申请 契约接口
 */
interface CreditApplyContract {

    /**
     * model 层接口类
     */
    interface Model {
        /**
         * 加载贷款额度信息
         */
        fun loadCreditApplyRequest()
        /**
         * 创建贷款申请订单
         */
        fun onSubmitCreditApplyOrderRequest()
    }

    /**
     * View 层接口
     */
    interface View: IBaseView{

        /**
         * 获取贷款额度信息成功
         */
        fun showCreditApplyInfoData(data: JSONObject)

        /**
         * 总流程存在订单 或 申请状态，需要返回首页
         */
        fun showCreditApplyFailed()

        /**
         * 贷款申请订单创建成功
         */
        fun showCreditApplyOrderCreateSuccess(data: JSONObject)
    }

    /**
     * Presenter 层接口
     */
    interface Presenter: IBasePresenter{

        /**
         * 获取贷款额度信息成功
         */
        fun onCreditApplyInfoSuccess(data: JSONObject)
        /**
         * 创建贷款申请订单成功
         */
        fun onCreditApplyOrderCreateSuccess(data: JSONObject)
    }
}